//
//  Person.swift
//  代理模式
//
//  Created by CaoFei on 14-7-11.
//  Copyright (c) 2014年 CaoFei. All rights reserved.
//

import Foundation
class Person : ChildDelegate {
    var age : Int?
    var sex : String?
    var name: String?
    var childName: [String]
    
    init( _sex : String! , _name:String!){
        sex = _sex
        name = _name
        //孤儿院
        childName = ["小明", "小海", "笑笑", "小伙", "小米", "小胖", "消消", "小乐", "小秘", "校花"]
    }
    
    class func thankYouSoMuch() {
    
    }
    
    //找孩子的代理方法
    
    func  lookForMyChild(name: String) -> String {
        //这里再孤儿院里开始 寻找 指定名称的孩子
        for child : String in childName {
            if name == child {
                return "OK"
            }
        }
        return "not found"
    }
}


